package dao;

/**
 * SaleDetailId entity. @author MyEclipse Persistence Tools
 */

public class SaleDetailId implements java.io.Serializable {

	// Fields

	private Sale sale;
	private Goods goods;

	// Constructors

	/** default constructor */
	public SaleDetailId() {
	}

	/** full constructor */
	public SaleDetailId(Sale sale, Goods goods) {
		this.sale = sale;
		this.goods = goods;
	}

	// Property accessors

	public Sale getSale() {
		return this.sale;
	}

	public void setSale(Sale sale) {
		this.sale = sale;
	}

	public Goods getGoods() {
		return this.goods;
	}

	public void setGoods(Goods goods) {
		this.goods = goods;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof SaleDetailId))
			return false;
		SaleDetailId castOther = (SaleDetailId) other;

		return ((this.getSale() == castOther.getSale()) || (this.getSale() != null
				&& castOther.getSale() != null && this.getSale().equals(
				castOther.getSale())))
				&& ((this.getGoods() == castOther.getGoods()) || (this
						.getGoods() != null
						&& castOther.getGoods() != null && this.getGoods()
						.equals(castOther.getGoods())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getSale() == null ? 0 : this.getSale().hashCode());
		result = 37 * result
				+ (getGoods() == null ? 0 : this.getGoods().hashCode());
		return result;
	}

}